///*
// *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
// *
// *  Redistribution and use in source and binary forms, with or without
// *  modification, are permitted provided that the following conditions are met:
// *
// *  Redistributions of source code must retain the above copyright notice,
// *  this list of conditions and the following disclaimer.
// *  Redistributions in binary form must reproduce the above copyright
// *  notice, this list of conditions and the following disclaimer in the
// *  documentation and/or other materials provided with the distribution.
// *  Neither the name of the dreamlu.net developer nor the names of its
// *  contributors may be used to endorse or promote products derived from
// *  this software without specific prior written permission.
// *  Author: Chill 庄骞 (smallchill@163.com)
// */
//package com.plian.system.controller.fr.bank;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.plian.Tools.DateUtil;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.config.Resubmit;
//import com.plian.system.dto.fr.bank.BankTradeDetailDTO;
//import com.plian.system.entity.fr.bank.BankTradeDetail;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.search.SearchEntity;
//import com.plian.system.mybatis.search.SearchParamEntiy;
//import com.plian.system.mybatis.search.TokenSearch;
//import com.plian.system.mybatis.support.Condition;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.fr.bank.IBankTradeDetailService;
//import com.plian.system.vo.fr.bank.BankTradeDetailVO;
//import com.plian.system.vo.fr.bank.TradeStatisticsVO;
//import com.plian.system.vo.report.ChartsVO;
//import com.plian.system.vo.report.ReportReturnVO;
//import com.plian.system.wrapper.fr.bank.BankTradeDetailWrapper;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.validation.Valid;
//import java.util.Date;
//import java.util.List;
//
///**
// * 控制器
// *
// * @author
// * @since 2020-07-17
// */
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/banktradedetail")
//public class BankTradeDetailController extends BaseController {
//
//	private IBankTradeDetailService bankTradeDetailService;
//
//	private BankTradeDetailWrapper bankTradeDetailWrapper;
//
//	/**
//	 * 详情
//	 */
//	@PostMapping("/detail")
//	public R<BankTradeDetailVO> detail(@RequestBody BankTradeDetail bankTradeDetail) {
//		BankTradeDetail detail = bankTradeDetailService.getOne(Condition.getQueryWrapper(bankTradeDetail));
//		R<BankTradeDetailVO> objResult = new R<>(CommonCode.SUCCESS);
//		BankTradeDetailVO bankTradeDetailVO = bankTradeDetailWrapper.entityToVO(detail);
//		objResult.setPageData(bankTradeDetailVO);
//		return objResult;
//	}
//
//	/**
//	 * 分页
//	 */
//	@PostMapping("/list")
//	public ListResult<BankTradeDetailVO> list(@RequestBody Query query) {
//		List<SearchEntity> entityList = query.getSearch();
//		if (query.getAscs()==null&&query.getDescs()==null){
//			query.setDescs("create_time");
//		}
//		QueryWrapper<BankTradeDetail> queryWrapper = SearchParamEntiy.getQueryWrapper(
//				Condition.getQueryWrapper(new BankTradeDetail()), entityList
//		);
//		TokenSearch<BankTradeDetail> tokenSearch = new TokenSearch<>();
//		tokenSearch.addTokenQuery(queryWrapper, query);
//		IPage<BankTradeDetail> pages = bankTradeDetailService.page(Condition.getPage(query), queryWrapper);
//		List<BankTradeDetailVO> projectInfoVOS = bankTradeDetailWrapper.entityToVO(pages.getRecords());
//		ListResult<BankTradeDetailVO> listResult = new ListResult<>(CommonCode.SUCCESS);
//		listResult.setList(projectInfoVOS);
//		listResult.setTotal(Long.valueOf(pages.getTotal()).intValue());
//		return listResult;
//	}
//
//	/**
//	 * 新增或修改
//	 */
//	@PostMapping("/submit")
//	@Resubmit(delaySeconds = 0)
//	public R submit(@Valid @RequestBody BankTradeDetail bankTradeDetail) {
//		return bankTradeDetailService.saveOrUpdate(bankTradeDetail)
//				? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//
//	}
//
//	/**
//	 * 删除
//	 */
//	@PostMapping("/remove")
//	public R remove(@RequestBody PageData pd) {
//		List<String> ids = (List<String>)pd.get("ids");
//		return bankTradeDetailService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)))
//				? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//	}
//
//	/**
//	 * 大额资金分析表格统计
//	 * @param bankTradeDetailDTO
//	 * @return
//	 */
//	@PostMapping("/blockTrade/statistics")
//	public R<ReportReturnVO> blockTradeStatistics(@RequestBody BankTradeDetailDTO bankTradeDetailDTO) {
//		R<ReportReturnVO> result = new R<>(CommonCode.SUCCESS);
//		result.setPageData(bankTradeDetailService.blockTradeStatistics(bankTradeDetailDTO));
//		return result;
//	}
//
//	/**
//	 * 大额资金分析
//	 * @param bankTradeDetailDTO
//	 * @return
//	 */
//	@PostMapping("/blockTrade/analyze")
//	public R<ChartsVO> blockTradeAnalyze(@RequestBody BankTradeDetailDTO bankTradeDetailDTO) {
//		R<ChartsVO> result = new R<>(CommonCode.SUCCESS);
//		result.setPageData(bankTradeDetailService.blockTradeAnalyze(bankTradeDetailDTO));
//		return result;
//	}
//
//	/**
//	 * 公转私交易情况分析表格统计
//	 * @param bankTradeDetailDTO
//	 * @return
//	 */
//	@PostMapping("/publicToPrivate/statistics")
//	public R<ReportReturnVO> publicToPrivateStatistics(@RequestBody BankTradeDetailDTO bankTradeDetailDTO) {
//		R<ReportReturnVO> result = new R<>(CommonCode.SUCCESS);
//		result.setPageData(bankTradeDetailService.publicToPrivateStatistics(bankTradeDetailDTO));
//		return result;
//	}
//
//
//	/**
//	 * 公转私分析
//	 * @param bankTradeDetailDTO
//	 * @return
//	 */
//	@PostMapping("/publicToPrivate/analyze")
//	public R<ChartsVO> publicToPrivateAnalyze(@RequestBody BankTradeDetailDTO bankTradeDetailDTO) {
//		R<ChartsVO> result = new R<>(CommonCode.SUCCESS);
//		result.setPageData(bankTradeDetailService.publicToPrivateAnalyze(bankTradeDetailDTO));
//		return result;
//	}
//
//	/**
//	 * 公转私预警展示
//	 * @return
//	 */
//	@PostMapping("/publicToPrivate/insertto")
//
//	public ListResult<TradeStatisticsVO> publicToPrivateInsertto(){
//		ListResult<TradeStatisticsVO> result = new ListResult<>(CommonCode.SUCCESS);
//		Date createTime = DateUtil.now();
//		String warningTime = DateUtil.format(createTime, "yyyy-MM");
//		PageData pageData = new PageData();
//		pageData.put("startTime",warningTime+"-01");
//		pageData.put("endTime",warningTime);
//		result.setList(bankTradeDetailService.Isprivate(pageData));
//		return result;
//	}
//
//
//	/**
//	 * 交易明细 统计接口
//	 * @param bankTradeDetailDTO
//	 * @return
//	 */
//	@PostMapping("/summaryList")
//	public R<ReportReturnVO> summaryList(@RequestBody BankTradeDetailDTO bankTradeDetailDTO){
//		ReportReturnVO reportReturnVO = bankTradeDetailService.summaryList(bankTradeDetailDTO);
//		R<ReportReturnVO> result = new R<>(CommonCode.SUCCESS);
//		result.setPageData(reportReturnVO);
//		return result;
//	}
//
//	/**
//	 * 交易明细 统计接口
//	 * @param pd
//	 * @return
//	 */
//	@PostMapping("/privateTopublicSummary")
//	public R<ReportReturnVO> privateTopublicSummary(@RequestBody PageData pd){
//		ReportReturnVO reportReturnVO = bankTradeDetailService.privateTopublicsummaryList(pd);
//		R<ReportReturnVO> result = new R<>(CommonCode.SUCCESS);
//		result.setPageData(reportReturnVO);
//		return result;
//	}
//}
